package com.djpeng.du.simple_pinyin;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by dujp on 15/5/2.
 * djpeng.du@gmail.com
 */
public class Table implements PinYinTable{
    private Map<String, String[]> table;

    public Table() {
        this.table = new HashMap<String, String[]>();
    }

    public Table(int size){
        this.table = new HashMap<String, String[]>(size);
    }

    public void setKey(String key, String[] value) {
        this.table.put(key, value);
    }

    public String[] getValue(String key) {
        String[] result = this.table.get(key);
        if(result == null || "none".equals(result[0])){
            return new String[0];
        }
        return result;
    }
}
